window.onload=function(){
    var li=document.querySelectorAll("footer ul li");
    var p=document.querySelectorAll("footer ul li p");
    var inde=document.querySelectorAll("footer ul li span");
    for(let i=0;i<li.length;i++){
        li[i].addEventListener("touchend",function(){
            for (let j = 0; j < li.length; j++) {
                inde[j].style.color="#ccc";
                p[j].style.background="url('../images/icon"+(j+1)+".png') no-repeat";
                p[j].style.backgroundSize=".373832rem";
            }
            inde[i].style.color="#1E4EAF";
            p[i].style.background="url('../images/icon"+(i+5)+".png') no-repeat";
            p[i].style.backgroundSize=".373832rem";

            console.log(this.childNodes[1]);
        })  
    }
}